/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Diana
 */
@Embeddable
public class SuministroEmpresaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id_empresa")
    private String idEmpresa;
    @Basic(optional = false)
    @Column(name = "id_suministro")
    private String idSuministro;

    public SuministroEmpresaPK() {
    }

    public SuministroEmpresaPK(String idEmpresa, String idSuministro) {
        this.idEmpresa = idEmpresa;
        this.idSuministro = idSuministro;
    }

    public String getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(String idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    public String getIdSuministro() {
        return idSuministro;
    }

    public void setIdSuministro(String idSuministro) {
        this.idSuministro = idSuministro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEmpresa != null ? idEmpresa.hashCode() : 0);
        hash += (idSuministro != null ? idSuministro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof SuministroEmpresaPK)) {
            return false;
        }
        SuministroEmpresaPK other = (SuministroEmpresaPK) object;
        if ((this.idEmpresa == null && other.idEmpresa != null) || (this.idEmpresa != null && !this.idEmpresa.equals(other.idEmpresa))) {
            return false;
        }
        if ((this.idSuministro == null && other.idSuministro != null) || (this.idSuministro != null && !this.idSuministro.equals(other.idSuministro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.SuministroEmpresaPK[idEmpresa=" + idEmpresa + ", idSuministro=" + idSuministro + "]";
    }

}
